package com.gobuy.goods.dao;


import com.gobuy.goods.pojo.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author Gaozexi on 2020/6/2 21:44
 * Step by Step  and Stand on,  You Are The Best Investment!
 */
public interface BrandMapper extends Mapper<Brand> {

    @Select("SELECT b.`name`,b.`image` FROM tb_brand b,tb_category c,tb_category_brand cb \n" +
            "\tWHERE b.`id`=cb.`brand_id` AND c.`id`=cb.`category_id` AND c.`name`=#{categoryName}")
    List<Map> findBrandListByCategoryName(@Param("categoryName") String categoryName);
}
